<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - iris.info - /usr/include/c++/4.3/bits/locale_classes.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../../../../index.html">directory</a> - <a href="index.html">usr/include/c++/4.3/bits</a> - locale_classes.h</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>iris.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-05-24</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">25</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">0.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">0</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : // Locale support -*- C++ -*-
<span class="lineNum">       2 </span>                : 
<span class="lineNum">       3 </span>                : // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
<span class="lineNum">       4 </span>                : // 2006, 2007, 2008
<span class="lineNum">       5 </span>                : // Free Software Foundation, Inc.
<span class="lineNum">       6 </span>                : //
<span class="lineNum">       7 </span>                : // This file is part of the GNU ISO C++ Library.  This library is free
<span class="lineNum">       8 </span>                : // software; you can redistribute it and/or modify it under the
<span class="lineNum">       9 </span>                : // terms of the GNU General Public License as published by the
<span class="lineNum">      10 </span>                : // Free Software Foundation; either version 2, or (at your option)
<span class="lineNum">      11 </span>                : // any later version.
<span class="lineNum">      12 </span>                : 
<span class="lineNum">      13 </span>                : // This library is distributed in the hope that it will be useful,
<span class="lineNum">      14 </span>                : // but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      15 </span>                : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class="lineNum">      16 </span>                : // GNU General Public License for more details.
<span class="lineNum">      17 </span>                : 
<span class="lineNum">      18 </span>                : // You should have received a copy of the GNU General Public License along
<span class="lineNum">      19 </span>                : // with this library; see the file COPYING.  If not, write to the Free
<span class="lineNum">      20 </span>                : // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
<span class="lineNum">      21 </span>                : // USA.
<span class="lineNum">      22 </span>                : 
<span class="lineNum">      23 </span>                : // As a special exception, you may use this file as part of a free software
<span class="lineNum">      24 </span>                : // library without restriction.  Specifically, if other files instantiate
<span class="lineNum">      25 </span>                : // templates or use macros or inline functions from this file, or you compile
<span class="lineNum">      26 </span>                : // this file and link it with other files to produce an executable, this
<span class="lineNum">      27 </span>                : // file does not by itself cause the resulting executable to be covered by
<span class="lineNum">      28 </span>                : // the GNU General Public License.  This exception does not however
<span class="lineNum">      29 </span>                : // invalidate any other reasons why the executable file might be covered by
<span class="lineNum">      30 </span>                : // the GNU General Public License.
<span class="lineNum">      31 </span>                : 
<span class="lineNum">      32 </span>                : /** @file locale_classes.h
<span class="lineNum">      33 </span>                :  *  This is an internal header file, included by other library headers.
<span class="lineNum">      34 </span>                :  *  You should not attempt to use it directly.
<span class="lineNum">      35 </span>                :  */
<span class="lineNum">      36 </span>                : 
<span class="lineNum">      37 </span>                : //
<span class="lineNum">      38 </span>                : // ISO C++ 14882: 22.1  Locales
<span class="lineNum">      39 </span>                : //
<span class="lineNum">      40 </span>                : 
<span class="lineNum">      41 </span>                : #ifndef _LOCALE_CLASSES_H
<span class="lineNum">      42 </span>                : #define _LOCALE_CLASSES_H 1
<span class="lineNum">      43 </span>                : 
<span class="lineNum">      44 </span>                : #pragma GCC system_header
<span class="lineNum">      45 </span>                : 
<span class="lineNum">      46 </span>                : #include &lt;bits/localefwd.h&gt;
<span class="lineNum">      47 </span>                : #include &lt;string&gt;
<span class="lineNum">      48 </span>                : #include &lt;ext/atomicity.h&gt;
<span class="lineNum">      49 </span>                : 
<span class="lineNum">      50 </span>                : _GLIBCXX_BEGIN_NAMESPACE(std)
<span class="lineNum">      51 </span>                : 
<span class="lineNum">      52 </span>                :   // 22.1.1 Class locale
<span class="lineNum">      53 </span>                :   /**
<span class="lineNum">      54 </span>                :    *  @brief  Container class for localization functionality.
<span class="lineNum">      55 </span>                :    *
<span class="lineNum">      56 </span>                :    *  The locale class is first a class wrapper for C library locales.  It is
<span class="lineNum">      57 </span>                :    *  also an extensible container for user-defined localization.  A locale is
<span class="lineNum">      58 </span>                :    *  a collection of facets that implement various localization features such
<span class="lineNum">      59 </span>                :    *  as money, time, and number printing.
<span class="lineNum">      60 </span>                :    *
<span class="lineNum">      61 </span>                :    *  Constructing C++ locales does not change the C library locale.
<span class="lineNum">      62 </span>                :    *
<span class="lineNum">      63 </span>                :    *  This library supports efficient construction and copying of locales
<span class="lineNum">      64 </span>                :    *  through a reference counting implementation of the locale class.
<span class="lineNum">      65 </span>                :   */
<span class="lineNum">      66 </span>                :   class locale
<span class="lineNum">      67 </span>                :   {
<span class="lineNum">      68 </span>                :   public:
<span class="lineNum">      69 </span>                :     // Types:
<span class="lineNum">      70 </span>                :     /// Definition of locale::category.
<span class="lineNum">      71 </span>                :     typedef int category;
<span class="lineNum">      72 </span>                : 
<span class="lineNum">      73 </span>                :     // Forward decls and friends:
<span class="lineNum">      74 </span>                :     class facet;
<span class="lineNum">      75 </span>                :     class id;
<span class="lineNum">      76 </span>                :     class _Impl;
<span class="lineNum">      77 </span>                : 
<span class="lineNum">      78 </span>                :     friend class facet;
<span class="lineNum">      79 </span>                :     friend class _Impl;
<span class="lineNum">      80 </span>                : 
<span class="lineNum">      81 </span>                :     template&lt;typename _Facet&gt;
<span class="lineNum">      82 </span>                :       friend bool
<span class="lineNum">      83 </span>                :       has_facet(const locale&amp;) throw();
<span class="lineNum">      84 </span>                : 
<span class="lineNum">      85 </span>                :     template&lt;typename _Facet&gt;
<span class="lineNum">      86 </span>                :       friend const _Facet&amp;
<span class="lineNum">      87 </span>                :       use_facet(const locale&amp;);
<span class="lineNum">      88 </span>                : 
<span class="lineNum">      89 </span>                :     template&lt;typename _Cache&gt;
<span class="lineNum">      90 </span>                :       friend struct __use_cache;
<span class="lineNum">      91 </span>                : 
<span class="lineNum">      92 </span>                :     //@{
<span class="lineNum">      93 </span>                :     /**
<span class="lineNum">      94 </span>                :      *  @brief  Category values.
<span class="lineNum">      95 </span>                :      *
<span class="lineNum">      96 </span>                :      *  The standard category values are none, ctype, numeric, collate, time,
<span class="lineNum">      97 </span>                :      *  monetary, and messages.  They form a bitmask that supports union and
<span class="lineNum">      98 </span>                :      *  intersection.  The category all is the union of these values.
<span class="lineNum">      99 </span>                :      *
<span class="lineNum">     100 </span>                :      *  NB: Order must match _S_facet_categories definition in locale.cc
<span class="lineNum">     101 </span>                :     */
<span class="lineNum">     102 </span>                :     static const category none          = 0;
<span class="lineNum">     103 </span>                :     static const category ctype         = 1L &lt;&lt; 0;
<span class="lineNum">     104 </span>                :     static const category numeric       = 1L &lt;&lt; 1;
<span class="lineNum">     105 </span>                :     static const category collate       = 1L &lt;&lt; 2;
<span class="lineNum">     106 </span>                :     static const category time          = 1L &lt;&lt; 3;
<span class="lineNum">     107 </span>                :     static const category monetary      = 1L &lt;&lt; 4;
<span class="lineNum">     108 </span>                :     static const category messages      = 1L &lt;&lt; 5;
<span class="lineNum">     109 </span>                :     static const category all           = (ctype | numeric | collate |
<span class="lineNum">     110 </span>                :                                            time  | monetary | messages);
<span class="lineNum">     111 </span>                :     //@}
<span class="lineNum">     112 </span>                : 
<span class="lineNum">     113 </span>                :     // Construct/copy/destroy:
<span class="lineNum">     114 </span>                : 
<span class="lineNum">     115 </span>                :     /**
<span class="lineNum">     116 </span>                :      *  @brief  Default constructor.
<span class="lineNum">     117 </span>                :      *
<span class="lineNum">     118 </span>                :      *  Constructs a copy of the global locale.  If no locale has been
<span class="lineNum">     119 </span>                :      *  explicitly set, this is the &quot;C&quot; locale.
<span class="lineNum">     120 </span>                :     */
<span class="lineNum">     121 </span>                :     locale() throw();
<span class="lineNum">     122 </span>                : 
<span class="lineNum">     123 </span>                :     /**
<span class="lineNum">     124 </span>                :      *  @brief  Copy constructor.
<span class="lineNum">     125 </span>                :      *
<span class="lineNum">     126 </span>                :      *  Constructs a copy of @a other.
<span class="lineNum">     127 </span>                :      *
<span class="lineNum">     128 </span>                :      *  @param  other  The locale to copy.
<span class="lineNum">     129 </span>                :     */
<span class="lineNum">     130 </span>                :     locale(const locale&amp; __other) throw();
<span class="lineNum">     131 </span>                : 
<span class="lineNum">     132 </span>                :     /**
<span class="lineNum">     133 </span>                :      *  @brief  Named locale constructor.
<span class="lineNum">     134 </span>                :      *
<span class="lineNum">     135 </span>                :      *  Constructs a copy of the named C library locale.
<span class="lineNum">     136 </span>                :      *
<span class="lineNum">     137 </span>                :      *  @param  s  Name of the locale to construct.
<span class="lineNum">     138 </span>                :      *  @throw  std::runtime_error if s is null or an undefined locale.
<span class="lineNum">     139 </span>                :     */
<span class="lineNum">     140 </span>                :     explicit
<span class="lineNum">     141 </span>                :     locale(const char* __s);
<span class="lineNum">     142 </span>                : 
<span class="lineNum">     143 </span>                :     /**
<span class="lineNum">     144 </span>                :      *  @brief  Construct locale with facets from another locale.
<span class="lineNum">     145 </span>                :      *
<span class="lineNum">     146 </span>                :      *  Constructs a copy of the locale @a base.  The facets specified by @a
<span class="lineNum">     147 </span>                :      *  cat are replaced with those from the locale named by @a s.  If base is
<span class="lineNum">     148 </span>                :      *  named, this locale instance will also be named.
<span class="lineNum">     149 </span>                :      *
<span class="lineNum">     150 </span>                :      *  @param  base  The locale to copy.
<span class="lineNum">     151 </span>                :      *  @param  s  Name of the locale to use facets from.
<span class="lineNum">     152 </span>                :      *  @param  cat  Set of categories defining the facets to use from s.
<span class="lineNum">     153 </span>                :      *  @throw  std::runtime_error if s is null or an undefined locale.
<span class="lineNum">     154 </span>                :     */
<span class="lineNum">     155 </span>                :     locale(const locale&amp; __base, const char* __s, category __cat);
<span class="lineNum">     156 </span>                : 
<span class="lineNum">     157 </span>                :     /**
<span class="lineNum">     158 </span>                :      *  @brief  Construct locale with facets from another locale.
<span class="lineNum">     159 </span>                :      *
<span class="lineNum">     160 </span>                :      *  Constructs a copy of the locale @a base.  The facets specified by @a
<span class="lineNum">     161 </span>                :      *  cat are replaced with those from the locale @a add.  If @a base and @a
<span class="lineNum">     162 </span>                :      *  add are named, this locale instance will also be named.
<span class="lineNum">     163 </span>                :      *
<span class="lineNum">     164 </span>                :      *  @param  base  The locale to copy.
<span class="lineNum">     165 </span>                :      *  @param  add  The locale to use facets from.
<span class="lineNum">     166 </span>                :      *  @param  cat  Set of categories defining the facets to use from add.
<span class="lineNum">     167 </span>                :     */
<span class="lineNum">     168 </span>                :     locale(const locale&amp; __base, const locale&amp; __add, category __cat);
<span class="lineNum">     169 </span>                : 
<span class="lineNum">     170 </span>                :     /**
<span class="lineNum">     171 </span>                :      *  @brief  Construct locale with another facet.
<span class="lineNum">     172 </span>                :      *
<span class="lineNum">     173 </span>                :      *  Constructs a copy of the locale @a other.  The facet @f is added to
<span class="lineNum">     174 </span>                :      *  @other, replacing an existing facet of type Facet if there is one.  If
<span class="lineNum">     175 </span>                :      *  @f is null, this locale is a copy of @a other.
<span class="lineNum">     176 </span>                :      *
<span class="lineNum">     177 </span>                :      *  @param  other  The locale to copy.
<span class="lineNum">     178 </span>                :      *  @param  f  The facet to add in.
<span class="lineNum">     179 </span>                :     */
<span class="lineNum">     180 </span>                :     template&lt;typename _Facet&gt;
<span class="lineNum">     181 </span>                :       locale(const locale&amp; __other, _Facet* __f);
<span class="lineNum">     182 </span>                : 
<span class="lineNum">     183 </span>                :     /// Locale destructor.
<span class="lineNum">     184 </span>                :     ~locale() throw();
<span class="lineNum">     185 </span>                : 
<span class="lineNum">     186 </span>                :     /**
<span class="lineNum">     187 </span>                :      *  @brief  Assignment operator.
<span class="lineNum">     188 </span>                :      *
<span class="lineNum">     189 </span>                :      *  Set this locale to be a copy of @a other.
<span class="lineNum">     190 </span>                :      *
<span class="lineNum">     191 </span>                :      *  @param  other  The locale to copy.
<span class="lineNum">     192 </span>                :      *  @return  A reference to this locale.
<span class="lineNum">     193 </span>                :     */
<span class="lineNum">     194 </span>                :     const locale&amp;
<span class="lineNum">     195 </span>                :     operator=(const locale&amp; __other) throw();
<span class="lineNum">     196 </span>                : 
<span class="lineNum">     197 </span>                :     /**
<span class="lineNum">     198 </span>                :      *  @brief  Construct locale with another facet.
<span class="lineNum">     199 </span>                :      *
<span class="lineNum">     200 </span>                :      *  Constructs and returns a new copy of this locale.  Adds or replaces an
<span class="lineNum">     201 </span>                :      *  existing facet of type Facet from the locale @a other into the new
<span class="lineNum">     202 </span>                :      *  locale.
<span class="lineNum">     203 </span>                :      *
<span class="lineNum">     204 </span>                :      *  @param  Facet  The facet type to copy from other
<span class="lineNum">     205 </span>                :      *  @param  other  The locale to copy from.
<span class="lineNum">     206 </span>                :      *  @return  Newly constructed locale.
<span class="lineNum">     207 </span>                :      *  @throw  std::runtime_error if other has no facet of type Facet.
<span class="lineNum">     208 </span>                :     */
<span class="lineNum">     209 </span>                :     template&lt;typename _Facet&gt;
<span class="lineNum">     210 </span>                :       locale
<span class="lineNum">     211 </span>                :       combine(const locale&amp; __other) const;
<span class="lineNum">     212 </span>                : 
<span class="lineNum">     213 </span>                :     // Locale operations:
<span class="lineNum">     214 </span>                :     /**
<span class="lineNum">     215 </span>                :      *  @brief  Return locale name.
<span class="lineNum">     216 </span>                :      *  @return  Locale name or &quot;*&quot; if unnamed.
<span class="lineNum">     217 </span>                :     */
<span class="lineNum">     218 </span>                :     string
<span class="lineNum">     219 </span>                :     name() const;
<span class="lineNum">     220 </span>                : 
<span class="lineNum">     221 </span>                :     /**
<span class="lineNum">     222 </span>                :      *  @brief  Locale equality.
<span class="lineNum">     223 </span>                :      *
<span class="lineNum">     224 </span>                :      *  @param  other  The locale to compare against.
<span class="lineNum">     225 </span>                :      *  @return  True if other and this refer to the same locale instance, are
<span class="lineNum">     226 </span>                :      *           copies, or have the same name.  False otherwise.
<span class="lineNum">     227 </span>                :     */
<span class="lineNum">     228 </span>                :     bool
<span class="lineNum">     229 </span>                :     operator==(const locale&amp; __other) const throw ();
<span class="lineNum">     230 </span>                : 
<span class="lineNum">     231 </span>                :     /**
<span class="lineNum">     232 </span>                :      *  @brief  Locale inequality.
<span class="lineNum">     233 </span>                :      *
<span class="lineNum">     234 </span>                :      *  @param  other  The locale to compare against.
<span class="lineNum">     235 </span>                :      *  @return  ! (*this == other)
<span class="lineNum">     236 </span>                :     */
<span class="lineNum">     237 </span>                :     bool
<span class="lineNum">     238 </span><span class="lineNoCov">              0 :     operator!=(const locale&amp; __other) const throw ()</span>
<span class="lineNum">     239 </span><span class="lineNoCov">              0 :     { return !(this-&gt;operator==(__other)); }</span>
<span class="lineNum">     240 </span>                : 
<span class="lineNum">     241 </span>                :     /**
<span class="lineNum">     242 </span>                :      *  @brief  Compare two strings according to collate.
<span class="lineNum">     243 </span>                :      *
<span class="lineNum">     244 </span>                :      *  Template operator to compare two strings using the compare function of
<span class="lineNum">     245 </span>                :      *  the collate facet in this locale.  One use is to provide the locale to
<span class="lineNum">     246 </span>                :      *  the sort function.  For example, a vector v of strings could be sorted
<span class="lineNum">     247 </span>                :      *  according to locale loc by doing:
<span class="lineNum">     248 </span>                :      *  @code
<span class="lineNum">     249 </span>                :      *  std::sort(v.begin(), v.end(), loc);
<span class="lineNum">     250 </span>                :      *  @endcode
<span class="lineNum">     251 </span>                :      *
<span class="lineNum">     252 </span>                :      *  @param  s1  First string to compare.
<span class="lineNum">     253 </span>                :      *  @param  s2  Second string to compare.
<span class="lineNum">     254 </span>                :      *  @return  True if collate&lt;Char&gt; facet compares s1 &lt; s2, else false.
<span class="lineNum">     255 </span>                :     */
<span class="lineNum">     256 </span>                :     template&lt;typename _Char, typename _Traits, typename _Alloc&gt;
<span class="lineNum">     257 </span>                :       bool
<span class="lineNum">     258 </span>                :       operator()(const basic_string&lt;_Char, _Traits, _Alloc&gt;&amp; __s1,
<span class="lineNum">     259 </span>                :                  const basic_string&lt;_Char, _Traits, _Alloc&gt;&amp; __s2) const;
<span class="lineNum">     260 </span>                : 
<span class="lineNum">     261 </span>                :     // Global locale objects:
<span class="lineNum">     262 </span>                :     /**
<span class="lineNum">     263 </span>                :      *  @brief  Set global locale
<span class="lineNum">     264 </span>                :      *
<span class="lineNum">     265 </span>                :      *  This function sets the global locale to the argument and returns a
<span class="lineNum">     266 </span>                :      *  copy of the previous global locale.  If the argument has a name, it
<span class="lineNum">     267 </span>                :      *  will also call std::setlocale(LC_ALL, loc.name()).
<span class="lineNum">     268 </span>                :      *
<span class="lineNum">     269 </span>                :      *  @param  locale  The new locale to make global.
<span class="lineNum">     270 </span>                :      *  @return  Copy of the old global locale.
<span class="lineNum">     271 </span>                :     */
<span class="lineNum">     272 </span>                :     static locale
<span class="lineNum">     273 </span>                :     global(const locale&amp;);
<span class="lineNum">     274 </span>                : 
<span class="lineNum">     275 </span>                :     /**
<span class="lineNum">     276 </span>                :      *  @brief  Return reference to the &quot;C&quot; locale.
<span class="lineNum">     277 </span>                :     */
<span class="lineNum">     278 </span>                :     static const locale&amp;
<span class="lineNum">     279 </span>                :     classic();
<span class="lineNum">     280 </span>                : 
<span class="lineNum">     281 </span>                :   private:
<span class="lineNum">     282 </span>                :     // The (shared) implementation
<span class="lineNum">     283 </span>                :     _Impl*              _M_impl;
<span class="lineNum">     284 </span>                : 
<span class="lineNum">     285 </span>                :     // The &quot;C&quot; reference locale
<span class="lineNum">     286 </span>                :     static _Impl*       _S_classic;
<span class="lineNum">     287 </span>                : 
<span class="lineNum">     288 </span>                :     // Current global locale
<span class="lineNum">     289 </span>                :     static _Impl*       _S_global;
<span class="lineNum">     290 </span>                : 
<span class="lineNum">     291 </span>                :     // Names of underlying locale categories.
<span class="lineNum">     292 </span>                :     // NB: locale::global() has to know how to modify all the
<span class="lineNum">     293 </span>                :     // underlying categories, not just the ones required by the C++
<span class="lineNum">     294 </span>                :     // standard.
<span class="lineNum">     295 </span>                :     static const char* const* const _S_categories;
<span class="lineNum">     296 </span>                : 
<span class="lineNum">     297 </span>                :     // Number of standard categories. For C++, these categories are
<span class="lineNum">     298 </span>                :     // collate, ctype, monetary, numeric, time, and messages. These
<span class="lineNum">     299 </span>                :     // directly correspond to ISO C99 macros LC_COLLATE, LC_CTYPE,
<span class="lineNum">     300 </span>                :     // LC_MONETARY, LC_NUMERIC, and LC_TIME. In addition, POSIX (IEEE
<span class="lineNum">     301 </span>                :     // 1003.1-2001) specifies LC_MESSAGES.
<span class="lineNum">     302 </span>                :     // In addition to the standard categories, the underlying
<span class="lineNum">     303 </span>                :     // operating system is allowed to define extra LC_*
<span class="lineNum">     304 </span>                :     // macros. For GNU systems, the following are also valid:
<span class="lineNum">     305 </span>                :     // LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT,
<span class="lineNum">     306 </span>                :     // and LC_IDENTIFICATION.
<span class="lineNum">     307 </span>                :     enum { _S_categories_size = 6 + _GLIBCXX_NUM_CATEGORIES };
<span class="lineNum">     308 </span>                : 
<span class="lineNum">     309 </span>                : #ifdef __GTHREADS
<span class="lineNum">     310 </span>                :     static __gthread_once_t _S_once;
<span class="lineNum">     311 </span>                : #endif
<span class="lineNum">     312 </span>                : 
<span class="lineNum">     313 </span>                :     explicit
<span class="lineNum">     314 </span>                :     locale(_Impl*) throw();
<span class="lineNum">     315 </span>                : 
<span class="lineNum">     316 </span>                :     static void
<span class="lineNum">     317 </span>                :     _S_initialize();
<span class="lineNum">     318 </span>                : 
<span class="lineNum">     319 </span>                :     static void
<span class="lineNum">     320 </span>                :     _S_initialize_once();
<span class="lineNum">     321 </span>                : 
<span class="lineNum">     322 </span>                :     static category
<span class="lineNum">     323 </span>                :     _S_normalize_category(category);
<span class="lineNum">     324 </span>                : 
<span class="lineNum">     325 </span>                :     void
<span class="lineNum">     326 </span>                :     _M_coalesce(const locale&amp; __base, const locale&amp; __add, category __cat);
<span class="lineNum">     327 </span>                :   };
<span class="lineNum">     328 </span>                : 
<span class="lineNum">     329 </span>                : 
<span class="lineNum">     330 </span>                :   // 22.1.1.1.2  Class locale::facet
<span class="lineNum">     331 </span>                :   /**
<span class="lineNum">     332 </span>                :    *  @brief  Localization functionality base class.
<span class="lineNum">     333 </span>                :    *
<span class="lineNum">     334 </span>                :    *  The facet class is the base class for a localization feature, such as
<span class="lineNum">     335 </span>                :    *  money, time, and number printing.  It provides common support for facets
<span class="lineNum">     336 </span>                :    *  and reference management.
<span class="lineNum">     337 </span>                :    *
<span class="lineNum">     338 </span>                :    *  Facets may not be copied or assigned.
<span class="lineNum">     339 </span>                :   */
<span class="lineNum">     340 </span>                :   class locale::facet
<span class="lineNum">     341 </span>                :   {
<span class="lineNum">     342 </span>                :   private:
<span class="lineNum">     343 </span>                :     friend class locale;
<span class="lineNum">     344 </span>                :     friend class locale::_Impl;
<span class="lineNum">     345 </span>                : 
<span class="lineNum">     346 </span>                :     mutable _Atomic_word                _M_refcount;
<span class="lineNum">     347 </span>                : 
<span class="lineNum">     348 </span>                :     // Contains data from the underlying &quot;C&quot; library for the classic locale.
<span class="lineNum">     349 </span>                :     static __c_locale                   _S_c_locale;
<span class="lineNum">     350 </span>                : 
<span class="lineNum">     351 </span>                :     // String literal for the name of the classic locale.
<span class="lineNum">     352 </span>                :     static const char                   _S_c_name[2];
<span class="lineNum">     353 </span>                : 
<span class="lineNum">     354 </span>                : #ifdef __GTHREADS
<span class="lineNum">     355 </span>                :     static __gthread_once_t             _S_once;
<span class="lineNum">     356 </span>                : #endif
<span class="lineNum">     357 </span>                : 
<span class="lineNum">     358 </span>                :     static void
<span class="lineNum">     359 </span>                :     _S_initialize_once();
<span class="lineNum">     360 </span>                : 
<span class="lineNum">     361 </span>                :   protected:
<span class="lineNum">     362 </span>                :     /**
<span class="lineNum">     363 </span>                :      *  @brief  Facet constructor.
<span class="lineNum">     364 </span>                :      *
<span class="lineNum">     365 </span>                :      *  This is the constructor provided by the standard.  If refs is 0, the
<span class="lineNum">     366 </span>                :      *  facet is destroyed when the last referencing locale is destroyed.
<span class="lineNum">     367 </span>                :      *  Otherwise the facet will never be destroyed.
<span class="lineNum">     368 </span>                :      *
<span class="lineNum">     369 </span>                :      *  @param refs  The initial value for reference count.
<span class="lineNum">     370 </span>                :     */
<span class="lineNum">     371 </span>                :     explicit
<span class="lineNum">     372 </span><span class="lineNoCov">              0 :     facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)</span>
<span class="lineNum">     373 </span><span class="lineNoCov">              0 :     { }</span>
<span class="lineNum">     374 </span>                : 
<span class="lineNum">     375 </span>                :     /// Facet destructor.
<span class="lineNum">     376 </span>                :     virtual
<span class="lineNum">     377 </span>                :     ~facet();
<span class="lineNum">     378 </span>                : 
<span class="lineNum">     379 </span>                :     static void
<span class="lineNum">     380 </span>                :     _S_create_c_locale(__c_locale&amp; __cloc, const char* __s,
<span class="lineNum">     381 </span>                :                        __c_locale __old = 0);
<span class="lineNum">     382 </span>                : 
<span class="lineNum">     383 </span>                :     static __c_locale
<span class="lineNum">     384 </span>                :     _S_clone_c_locale(__c_locale&amp; __cloc);
<span class="lineNum">     385 </span>                : 
<span class="lineNum">     386 </span>                :     static void
<span class="lineNum">     387 </span>                :     _S_destroy_c_locale(__c_locale&amp; __cloc);
<span class="lineNum">     388 </span>                : 
<span class="lineNum">     389 </span>                :     // Returns data from the underlying &quot;C&quot; library data for the
<span class="lineNum">     390 </span>                :     // classic locale.
<span class="lineNum">     391 </span>                :     static __c_locale
<span class="lineNum">     392 </span>                :     _S_get_c_locale();
<span class="lineNum">     393 </span>                : 
<span class="lineNum">     394 </span>                :     static const char*
<span class="lineNum">     395 </span>                :     _S_get_c_name();
<span class="lineNum">     396 </span>                : 
<span class="lineNum">     397 </span>                :   private:
<span class="lineNum">     398 </span>                :     void
<span class="lineNum">     399 </span><span class="lineNoCov">              0 :     _M_add_reference() const throw()</span>
<span class="lineNum">     400 </span><span class="lineNoCov">              0 :     { __gnu_cxx::__atomic_add_dispatch(&amp;_M_refcount, 1); }</span>
<span class="lineNum">     401 </span>                : 
<span class="lineNum">     402 </span>                :     void
<span class="lineNum">     403 </span><span class="lineNoCov">              0 :     _M_remove_reference() const throw()</span>
<span class="lineNum">     404 </span><span class="lineNoCov">              0 :     {</span>
<span class="lineNum">     405 </span><span class="lineNoCov">              0 :       if (__gnu_cxx::__exchange_and_add_dispatch(&amp;_M_refcount, -1) == 1)</span>
<span class="lineNum">     406 </span>                :         {
<span class="lineNum">     407 </span>                :           try
<span class="lineNum">     408 </span><span class="lineNoCov">              0 :             { delete this; }</span>
<span class="lineNum">     409 </span><span class="lineNoCov">              0 :           catch(...)</span>
<span class="lineNum">     410 </span>                :             { }
<span class="lineNum">     411 </span>                :         }
<span class="lineNum">     412 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     413 </span>                : 
<span class="lineNum">     414 </span>                :     facet(const facet&amp;);  // Not defined.
<span class="lineNum">     415 </span>                : 
<span class="lineNum">     416 </span>                :     facet&amp;
<span class="lineNum">     417 </span>                :     operator=(const facet&amp;);  // Not defined.
<span class="lineNum">     418 </span>                :   };
<span class="lineNum">     419 </span>                : 
<span class="lineNum">     420 </span>                : 
<span class="lineNum">     421 </span>                :   // 22.1.1.1.3 Class locale::id
<span class="lineNum">     422 </span>                :   /**
<span class="lineNum">     423 </span>                :    *  @brief  Facet ID class.
<span class="lineNum">     424 </span>                :    *
<span class="lineNum">     425 </span>                :    *  The ID class provides facets with an index used to identify them.
<span class="lineNum">     426 </span>                :    *  Every facet class must define a public static member locale::id, or be
<span class="lineNum">     427 </span>                :    *  derived from a facet that provides this member, otherwise the facet
<span class="lineNum">     428 </span>                :    *  cannot be used in a locale.  The locale::id ensures that each class
<span class="lineNum">     429 </span>                :    *  type gets a unique identifier.
<span class="lineNum">     430 </span>                :   */
<span class="lineNum">     431 </span>                :   class locale::id
<span class="lineNum">     432 </span>                :   {
<span class="lineNum">     433 </span>                :   private:
<span class="lineNum">     434 </span>                :     friend class locale;
<span class="lineNum">     435 </span>                :     friend class locale::_Impl;
<span class="lineNum">     436 </span>                : 
<span class="lineNum">     437 </span>                :     template&lt;typename _Facet&gt;
<span class="lineNum">     438 </span>                :       friend const _Facet&amp;
<span class="lineNum">     439 </span>                :       use_facet(const locale&amp;);
<span class="lineNum">     440 </span>                : 
<span class="lineNum">     441 </span>                :     template&lt;typename _Facet&gt;
<span class="lineNum">     442 </span>                :       friend bool
<span class="lineNum">     443 </span>                :       has_facet(const locale&amp;) throw ();
<span class="lineNum">     444 </span>                : 
<span class="lineNum">     445 </span>                :     // NB: There is no accessor for _M_index because it may be used
<span class="lineNum">     446 </span>                :     // before the constructor is run; the effect of calling a member
<span class="lineNum">     447 </span>                :     // function (even an inline) would be undefined.
<span class="lineNum">     448 </span>                :     mutable size_t              _M_index;
<span class="lineNum">     449 </span>                : 
<span class="lineNum">     450 </span>                :     // Last id number assigned.
<span class="lineNum">     451 </span>                :     static _Atomic_word         _S_refcount;
<span class="lineNum">     452 </span>                : 
<span class="lineNum">     453 </span>                :     void
<span class="lineNum">     454 </span>                :     operator=(const id&amp;);  // Not defined.
<span class="lineNum">     455 </span>                : 
<span class="lineNum">     456 </span>                :     id(const id&amp;);  // Not defined.
<span class="lineNum">     457 </span>                : 
<span class="lineNum">     458 </span>                :   public:
<span class="lineNum">     459 </span>                :     // NB: This class is always a static data member, and thus can be
<span class="lineNum">     460 </span>                :     // counted on to be zero-initialized.
<span class="lineNum">     461 </span>                :     /// Constructor.
<span class="lineNum">     462 </span><span class="lineNoCov">              0 :     id() { }</span>
<span class="lineNum">     463 </span>                : 
<span class="lineNum">     464 </span>                :     size_t
<span class="lineNum">     465 </span>                :     _M_id() const;
<span class="lineNum">     466 </span>                :   };
<span class="lineNum">     467 </span>                : 
<span class="lineNum">     468 </span>                : 
<span class="lineNum">     469 </span>                :   // Implementation object for locale.
<span class="lineNum">     470 </span>                :   class locale::_Impl
<span class="lineNum">     471 </span>                :   {
<span class="lineNum">     472 </span>                :   public:
<span class="lineNum">     473 </span>                :     // Friends.
<span class="lineNum">     474 </span>                :     friend class locale;
<span class="lineNum">     475 </span>                :     friend class locale::facet;
<span class="lineNum">     476 </span>                : 
<span class="lineNum">     477 </span>                :     template&lt;typename _Facet&gt;
<span class="lineNum">     478 </span>                :       friend bool
<span class="lineNum">     479 </span>                :       has_facet(const locale&amp;) throw();
<span class="lineNum">     480 </span>                : 
<span class="lineNum">     481 </span>                :     template&lt;typename _Facet&gt;
<span class="lineNum">     482 </span>                :       friend const _Facet&amp;
<span class="lineNum">     483 </span>                :       use_facet(const locale&amp;);
<span class="lineNum">     484 </span>                : 
<span class="lineNum">     485 </span>                :     template&lt;typename _Cache&gt;
<span class="lineNum">     486 </span>                :       friend struct __use_cache;
<span class="lineNum">     487 </span>                : 
<span class="lineNum">     488 </span>                :   private:
<span class="lineNum">     489 </span>                :     // Data Members.
<span class="lineNum">     490 </span>                :     _Atomic_word                        _M_refcount;
<span class="lineNum">     491 </span>                :     const facet**                       _M_facets;
<span class="lineNum">     492 </span>                :     size_t                              _M_facets_size;
<span class="lineNum">     493 </span>                :     const facet**                       _M_caches;
<span class="lineNum">     494 </span>                :     char**                              _M_names;
<span class="lineNum">     495 </span>                :     static const locale::id* const      _S_id_ctype[];
<span class="lineNum">     496 </span>                :     static const locale::id* const      _S_id_numeric[];
<span class="lineNum">     497 </span>                :     static const locale::id* const      _S_id_collate[];
<span class="lineNum">     498 </span>                :     static const locale::id* const      _S_id_time[];
<span class="lineNum">     499 </span>                :     static const locale::id* const      _S_id_monetary[];
<span class="lineNum">     500 </span>                :     static const locale::id* const      _S_id_messages[];
<span class="lineNum">     501 </span>                :     static const locale::id* const* const _S_facet_categories[];
<span class="lineNum">     502 </span>                : 
<span class="lineNum">     503 </span>                :     void
<span class="lineNum">     504 </span><span class="lineNoCov">              0 :     _M_add_reference() throw()</span>
<span class="lineNum">     505 </span><span class="lineNoCov">              0 :     { __gnu_cxx::__atomic_add_dispatch(&amp;_M_refcount, 1); }</span>
<span class="lineNum">     506 </span>                : 
<span class="lineNum">     507 </span>                :     void
<span class="lineNum">     508 </span><span class="lineNoCov">              0 :     _M_remove_reference() throw()</span>
<span class="lineNum">     509 </span>                :     {
<span class="lineNum">     510 </span><span class="lineNoCov">              0 :       if (__gnu_cxx::__exchange_and_add_dispatch(&amp;_M_refcount, -1) == 1)</span>
<span class="lineNum">     511 </span>                :         {
<span class="lineNum">     512 </span>                :           try
<span class="lineNum">     513 </span><span class="lineNoCov">              0 :             { delete this; }</span>
<span class="lineNum">     514 </span>                :           catch(...)
<span class="lineNum">     515 </span>                :             { }
<span class="lineNum">     516 </span>                :         }
<span class="lineNum">     517 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     518 </span>                : 
<span class="lineNum">     519 </span>                :     _Impl(const _Impl&amp;, size_t);
<span class="lineNum">     520 </span>                :     _Impl(const char*, size_t);
<span class="lineNum">     521 </span>                :     _Impl(size_t) throw();
<span class="lineNum">     522 </span>                : 
<span class="lineNum">     523 </span>                :    ~_Impl() throw();
<span class="lineNum">     524 </span>                : 
<span class="lineNum">     525 </span>                :     _Impl(const _Impl&amp;);  // Not defined.
<span class="lineNum">     526 </span>                : 
<span class="lineNum">     527 </span>                :     void
<span class="lineNum">     528 </span>                :     operator=(const _Impl&amp;);  // Not defined.
<span class="lineNum">     529 </span>                : 
<span class="lineNum">     530 </span>                :     bool
<span class="lineNum">     531 </span><span class="lineNoCov">              0 :     _M_check_same_name()</span>
<span class="lineNum">     532 </span>                :     {
<span class="lineNum">     533 </span><span class="lineNoCov">              0 :       bool __ret = true;</span>
<span class="lineNum">     534 </span><span class="lineNoCov">              0 :       if (_M_names[1])</span>
<span class="lineNum">     535 </span>                :         // We must actually compare all the _M_names: can be all equal!
<span class="lineNum">     536 </span><span class="lineNoCov">              0 :         for (size_t __i = 0; __ret &amp;&amp; __i &lt; _S_categories_size - 1; ++__i)</span>
<span class="lineNum">     537 </span><span class="lineNoCov">              0 :           __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;</span>
<span class="lineNum">     538 </span><span class="lineNoCov">              0 :       return __ret;</span>
<span class="lineNum">     539 </span>                :     }
<span class="lineNum">     540 </span>                : 
<span class="lineNum">     541 </span>                :     void
<span class="lineNum">     542 </span>                :     _M_replace_categories(const _Impl*, category);
<span class="lineNum">     543 </span>                : 
<span class="lineNum">     544 </span>                :     void
<span class="lineNum">     545 </span>                :     _M_replace_category(const _Impl*, const locale::id* const*);
<span class="lineNum">     546 </span>                : 
<span class="lineNum">     547 </span>                :     void
<span class="lineNum">     548 </span>                :     _M_replace_facet(const _Impl*, const locale::id*);
<span class="lineNum">     549 </span>                : 
<span class="lineNum">     550 </span>                :     void
<span class="lineNum">     551 </span>                :     _M_install_facet(const locale::id*, const facet*);
<span class="lineNum">     552 </span>                : 
<span class="lineNum">     553 </span>                :     template&lt;typename _Facet&gt;
<span class="lineNum">     554 </span>                :       void
<span class="lineNum">     555 </span>                :       _M_init_facet(_Facet* __facet)
<span class="lineNum">     556 </span>                :       { _M_install_facet(&amp;_Facet::id, __facet); }
<span class="lineNum">     557 </span>                : 
<span class="lineNum">     558 </span>                :     void
<span class="lineNum">     559 </span>                :     _M_install_cache(const facet*, size_t);
<span class="lineNum">     560 </span>                :   };
<span class="lineNum">     561 </span>                : 
<span class="lineNum">     562 </span>                : 
<span class="lineNum">     563 </span>                :   /**
<span class="lineNum">     564 </span>                :    *  @brief  Test for the presence of a facet.
<span class="lineNum">     565 </span>                :    *
<span class="lineNum">     566 </span>                :    *  has_facet tests the locale argument for the presence of the facet type
<span class="lineNum">     567 </span>                :    *  provided as the template parameter.  Facets derived from the facet
<span class="lineNum">     568 </span>                :    *  parameter will also return true.
<span class="lineNum">     569 </span>                :    *
<span class="lineNum">     570 </span>                :    *  @param  Facet  The facet type to test the presence of.
<span class="lineNum">     571 </span>                :    *  @param  locale  The locale to test.
<span class="lineNum">     572 </span>                :    *  @return  true if locale contains a facet of type Facet, else false.
<span class="lineNum">     573 </span>                :   */
<span class="lineNum">     574 </span>                :   template&lt;typename _Facet&gt;
<span class="lineNum">     575 </span>                :     bool
<span class="lineNum">     576 </span>                :     has_facet(const locale&amp; __loc) throw();
<span class="lineNum">     577 </span>                : 
<span class="lineNum">     578 </span>                :   /**
<span class="lineNum">     579 </span>                :    *  @brief  Return a facet.
<span class="lineNum">     580 </span>                :    *
<span class="lineNum">     581 </span>                :    *  use_facet looks for and returns a reference to a facet of type Facet
<span class="lineNum">     582 </span>                :    *  where Facet is the template parameter.  If has_facet(locale) is true,
<span class="lineNum">     583 </span>                :    *  there is a suitable facet to return.  It throws std::bad_cast if the
<span class="lineNum">     584 </span>                :    *  locale doesn't contain a facet of type Facet.
<span class="lineNum">     585 </span>                :    *
<span class="lineNum">     586 </span>                :    *  @param  Facet  The facet type to access.
<span class="lineNum">     587 </span>                :    *  @param  locale  The locale to use.
<span class="lineNum">     588 </span>                :    *  @return  Reference to facet of type Facet.
<span class="lineNum">     589 </span>                :    *  @throw  std::bad_cast if locale doesn't contain a facet of type Facet.
<span class="lineNum">     590 </span>                :   */
<span class="lineNum">     591 </span>                :   template&lt;typename _Facet&gt;
<span class="lineNum">     592 </span>                :     const _Facet&amp;
<span class="lineNum">     593 </span>                :     use_facet(const locale&amp; __loc);
<span class="lineNum">     594 </span>                : 
<span class="lineNum">     595 </span>                : 
<span class="lineNum">     596 </span>                :   /**
<span class="lineNum">     597 </span>                :    *  @brief  Facet for localized string comparison.
<span class="lineNum">     598 </span>                :    *
<span class="lineNum">     599 </span>                :    *  This facet encapsulates the code to compare strings in a localized
<span class="lineNum">     600 </span>                :    *  manner.
<span class="lineNum">     601 </span>                :    *
<span class="lineNum">     602 </span>                :    *  The collate template uses protected virtual functions to provide
<span class="lineNum">     603 </span>                :    *  the actual results.  The public accessors forward the call to
<span class="lineNum">     604 </span>                :    *  the virtual functions.  These virtual functions are hooks for
<span class="lineNum">     605 </span>                :    *  developers to implement the behavior they require from the
<span class="lineNum">     606 </span>                :    *  collate facet.
<span class="lineNum">     607 </span>                :   */
<span class="lineNum">     608 </span>                :   template&lt;typename _CharT&gt;
<span class="lineNum">     609 </span>                :     class collate : public locale::facet
<span class="lineNum">     610 </span>                :     {
<span class="lineNum">     611 </span>                :     public:
<span class="lineNum">     612 </span>                :       // Types:
<span class="lineNum">     613 </span>                :       //@{
<span class="lineNum">     614 </span>                :       /// Public typedefs
<span class="lineNum">     615 </span>                :       typedef _CharT                    char_type;
<span class="lineNum">     616 </span>                :       typedef basic_string&lt;_CharT&gt;        string_type;
<span class="lineNum">     617 </span>                :       //@}
<span class="lineNum">     618 </span>                : 
<span class="lineNum">     619 </span>                :     protected:
<span class="lineNum">     620 </span>                :       // Underlying &quot;C&quot; library locale information saved from
<span class="lineNum">     621 </span>                :       // initialization, needed by collate_byname as well.
<span class="lineNum">     622 </span>                :       __c_locale                        _M_c_locale_collate;
<span class="lineNum">     623 </span>                : 
<span class="lineNum">     624 </span>                :     public:
<span class="lineNum">     625 </span>                :       /// Numpunct facet id.
<span class="lineNum">     626 </span>                :       static locale::id                 id;
<span class="lineNum">     627 </span>                : 
<span class="lineNum">     628 </span>                :       /**
<span class="lineNum">     629 </span>                :        *  @brief  Constructor performs initialization.
<span class="lineNum">     630 </span>                :        *
<span class="lineNum">     631 </span>                :        *  This is the constructor provided by the standard.
<span class="lineNum">     632 </span>                :        *
<span class="lineNum">     633 </span>                :        *  @param refs  Passed to the base facet class.
<span class="lineNum">     634 </span>                :       */
<span class="lineNum">     635 </span>                :       explicit
<span class="lineNum">     636 </span>                :       collate(size_t __refs = 0)
<span class="lineNum">     637 </span>                :       : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
<span class="lineNum">     638 </span>                :       { }
<span class="lineNum">     639 </span>                : 
<span class="lineNum">     640 </span>                :       /**
<span class="lineNum">     641 </span>                :        *  @brief  Internal constructor. Not for general use.
<span class="lineNum">     642 </span>                :        *
<span class="lineNum">     643 </span>                :        *  This is a constructor for use by the library itself to set up new
<span class="lineNum">     644 </span>                :        *  locales.
<span class="lineNum">     645 </span>                :        *
<span class="lineNum">     646 </span>                :        *  @param cloc  The &quot;C&quot; locale.
<span class="lineNum">     647 </span>                :        *  @param refs  Passed to the base facet class.
<span class="lineNum">     648 </span>                :       */
<span class="lineNum">     649 </span>                :       explicit
<span class="lineNum">     650 </span>                :       collate(__c_locale __cloc, size_t __refs = 0)
<span class="lineNum">     651 </span>                :       : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
<span class="lineNum">     652 </span>                :       { }
<span class="lineNum">     653 </span>                : 
<span class="lineNum">     654 </span>                :       /**
<span class="lineNum">     655 </span>                :        *  @brief  Compare two strings.
<span class="lineNum">     656 </span>                :        *
<span class="lineNum">     657 </span>                :        *  This function compares two strings and returns the result by calling
<span class="lineNum">     658 </span>                :        *  collate::do_compare().
<span class="lineNum">     659 </span>                :        *
<span class="lineNum">     660 </span>                :        *  @param lo1  Start of string 1.
<span class="lineNum">     661 </span>                :        *  @param hi1  End of string 1.
<span class="lineNum">     662 </span>                :        *  @param lo2  Start of string 2.
<span class="lineNum">     663 </span>                :        *  @param hi2  End of string 2.
<span class="lineNum">     664 </span>                :        *  @return  1 if string1 &gt; string2, -1 if string1 &lt; string2, else 0.
<span class="lineNum">     665 </span>                :       */
<span class="lineNum">     666 </span>                :       int
<span class="lineNum">     667 </span>                :       compare(const _CharT* __lo1, const _CharT* __hi1,
<span class="lineNum">     668 </span>                :               const _CharT* __lo2, const _CharT* __hi2) const
<span class="lineNum">     669 </span>                :       { return this-&gt;do_compare(__lo1, __hi1, __lo2, __hi2); }
<span class="lineNum">     670 </span>                : 
<span class="lineNum">     671 </span>                :       /**
<span class="lineNum">     672 </span>                :        *  @brief  Transform string to comparable form.
<span class="lineNum">     673 </span>                :        *
<span class="lineNum">     674 </span>                :        *  This function is a wrapper for strxfrm functionality.  It takes the
<span class="lineNum">     675 </span>                :        *  input string and returns a modified string that can be directly
<span class="lineNum">     676 </span>                :        *  compared to other transformed strings.  In the &quot;C&quot; locale, this
<span class="lineNum">     677 </span>                :        *  function just returns a copy of the input string.  In some other
<span class="lineNum">     678 </span>                :        *  locales, it may replace two chars with one, change a char for
<span class="lineNum">     679 </span>                :        *  another, etc.  It does so by returning collate::do_transform().
<span class="lineNum">     680 </span>                :        *
<span class="lineNum">     681 </span>                :        *  @param lo  Start of string.
<span class="lineNum">     682 </span>                :        *  @param hi  End of string.
<span class="lineNum">     683 </span>                :        *  @return  Transformed string_type.
<span class="lineNum">     684 </span>                :       */
<span class="lineNum">     685 </span>                :       string_type
<span class="lineNum">     686 </span>                :       transform(const _CharT* __lo, const _CharT* __hi) const
<span class="lineNum">     687 </span>                :       { return this-&gt;do_transform(__lo, __hi); }
<span class="lineNum">     688 </span>                : 
<span class="lineNum">     689 </span>                :       /**
<span class="lineNum">     690 </span>                :        *  @brief  Return hash of a string.
<span class="lineNum">     691 </span>                :        *
<span class="lineNum">     692 </span>                :        *  This function computes and returns a hash on the input string.  It
<span class="lineNum">     693 </span>                :        *  does so by returning collate::do_hash().
<span class="lineNum">     694 </span>                :        *
<span class="lineNum">     695 </span>                :        *  @param lo  Start of string.
<span class="lineNum">     696 </span>                :        *  @param hi  End of string.
<span class="lineNum">     697 </span>                :        *  @return  Hash value.
<span class="lineNum">     698 </span>                :       */
<span class="lineNum">     699 </span>                :       long
<span class="lineNum">     700 </span>                :       hash(const _CharT* __lo, const _CharT* __hi) const
<span class="lineNum">     701 </span>                :       { return this-&gt;do_hash(__lo, __hi); }
<span class="lineNum">     702 </span>                : 
<span class="lineNum">     703 </span>                :       // Used to abstract out _CharT bits in virtual member functions, below.
<span class="lineNum">     704 </span>                :       int
<span class="lineNum">     705 </span>                :       _M_compare(const _CharT*, const _CharT*) const;
<span class="lineNum">     706 </span>                : 
<span class="lineNum">     707 </span>                :       size_t
<span class="lineNum">     708 </span>                :       _M_transform(_CharT*, const _CharT*, size_t) const;
<span class="lineNum">     709 </span>                : 
<span class="lineNum">     710 </span>                :   protected:
<span class="lineNum">     711 </span>                :       /// Destructor.
<span class="lineNum">     712 </span>                :       virtual
<span class="lineNum">     713 </span>                :       ~collate()
<span class="lineNum">     714 </span>                :       { _S_destroy_c_locale(_M_c_locale_collate); }
<span class="lineNum">     715 </span>                : 
<span class="lineNum">     716 </span>                :       /**
<span class="lineNum">     717 </span>                :        *  @brief  Compare two strings.
<span class="lineNum">     718 </span>                :        *
<span class="lineNum">     719 </span>                :        *  This function is a hook for derived classes to change the value
<span class="lineNum">     720 </span>                :        *  returned.  @see compare().
<span class="lineNum">     721 </span>                :        *
<span class="lineNum">     722 </span>                :        *  @param lo1  Start of string 1.
<span class="lineNum">     723 </span>                :        *  @param hi1  End of string 1.
<span class="lineNum">     724 </span>                :        *  @param lo2  Start of string 2.
<span class="lineNum">     725 </span>                :        *  @param hi2  End of string 2.
<span class="lineNum">     726 </span>                :        *  @return  1 if string1 &gt; string2, -1 if string1 &lt; string2, else 0.
<span class="lineNum">     727 </span>                :       */
<span class="lineNum">     728 </span>                :       virtual int
<span class="lineNum">     729 </span>                :       do_compare(const _CharT* __lo1, const _CharT* __hi1,
<span class="lineNum">     730 </span>                :                  const _CharT* __lo2, const _CharT* __hi2) const;
<span class="lineNum">     731 </span>                : 
<span class="lineNum">     732 </span>                :       /**
<span class="lineNum">     733 </span>                :        *  @brief  Transform string to comparable form.
<span class="lineNum">     734 </span>                :        *
<span class="lineNum">     735 </span>                :        *  This function is a hook for derived classes to change the value
<span class="lineNum">     736 </span>                :        *  returned.
<span class="lineNum">     737 </span>                :        *
<span class="lineNum">     738 </span>                :        *  @param lo1  Start of string 1.
<span class="lineNum">     739 </span>                :        *  @param hi1  End of string 1.
<span class="lineNum">     740 </span>                :        *  @param lo2  Start of string 2.
<span class="lineNum">     741 </span>                :        *  @param hi2  End of string 2.
<span class="lineNum">     742 </span>                :        *  @return  1 if string1 &gt; string2, -1 if string1 &lt; string2, else 0.
<span class="lineNum">     743 </span>                :       */
<span class="lineNum">     744 </span>                :       virtual string_type
<span class="lineNum">     745 </span>                :       do_transform(const _CharT* __lo, const _CharT* __hi) const;
<span class="lineNum">     746 </span>                : 
<span class="lineNum">     747 </span>                :       /**
<span class="lineNum">     748 </span>                :        *  @brief  Return hash of a string.
<span class="lineNum">     749 </span>                :        *
<span class="lineNum">     750 </span>                :        *  This function computes and returns a hash on the input string.  This
<span class="lineNum">     751 </span>                :        *  function is a hook for derived classes to change the value returned.
<span class="lineNum">     752 </span>                :        *
<span class="lineNum">     753 </span>                :        *  @param lo  Start of string.
<span class="lineNum">     754 </span>                :        *  @param hi  End of string.
<span class="lineNum">     755 </span>                :        *  @return  Hash value.
<span class="lineNum">     756 </span>                :       */
<span class="lineNum">     757 </span>                :       virtual long
<span class="lineNum">     758 </span>                :       do_hash(const _CharT* __lo, const _CharT* __hi) const;
<span class="lineNum">     759 </span>                :     };
<span class="lineNum">     760 </span>                : 
<span class="lineNum">     761 </span>                :   template&lt;typename _CharT&gt;
<span class="lineNum">     762 </span>                :     locale::id collate&lt;_CharT&gt;::id;
<span class="lineNum">     763 </span>                : 
<span class="lineNum">     764 </span>                :   // Specializations.
<span class="lineNum">     765 </span>                :   template&lt;&gt;
<span class="lineNum">     766 </span>                :     int
<span class="lineNum">     767 </span>                :     collate&lt;char&gt;::_M_compare(const char*, const char*) const;
<span class="lineNum">     768 </span>                : 
<span class="lineNum">     769 </span>                :   template&lt;&gt;
<span class="lineNum">     770 </span>                :     size_t
<span class="lineNum">     771 </span>                :     collate&lt;char&gt;::_M_transform(char*, const char*, size_t) const;
<span class="lineNum">     772 </span>                : 
<span class="lineNum">     773 </span>                : #ifdef _GLIBCXX_USE_WCHAR_T
<span class="lineNum">     774 </span>                :   template&lt;&gt;
<span class="lineNum">     775 </span>                :     int
<span class="lineNum">     776 </span>                :     collate&lt;wchar_t&gt;::_M_compare(const wchar_t*, const wchar_t*) const;
<span class="lineNum">     777 </span>                : 
<span class="lineNum">     778 </span>                :   template&lt;&gt;
<span class="lineNum">     779 </span>                :     size_t
<span class="lineNum">     780 </span>                :     collate&lt;wchar_t&gt;::_M_transform(wchar_t*, const wchar_t*, size_t) const;
<span class="lineNum">     781 </span>                : #endif
<span class="lineNum">     782 </span>                : 
<span class="lineNum">     783 </span>                :   /// class collate_byname [22.2.4.2].
<span class="lineNum">     784 </span>                :   template&lt;typename _CharT&gt;
<span class="lineNum">     785 </span>                :     class collate_byname : public collate&lt;_CharT&gt;
<span class="lineNum">     786 </span>                :     {
<span class="lineNum">     787 </span>                :     public:
<span class="lineNum">     788 </span>                :       //@{
<span class="lineNum">     789 </span>                :       /// Public typedefs
<span class="lineNum">     790 </span>                :       typedef _CharT               char_type;
<span class="lineNum">     791 </span>                :       typedef basic_string&lt;_CharT&gt; string_type;
<span class="lineNum">     792 </span>                :       //@}
<span class="lineNum">     793 </span>                : 
<span class="lineNum">     794 </span>                :       explicit
<span class="lineNum">     795 </span>                :       collate_byname(const char* __s, size_t __refs = 0)
<span class="lineNum">     796 </span>                :       : collate&lt;_CharT&gt;(__refs)
<span class="lineNum">     797 </span>                :       {
<span class="lineNum">     798 </span>                :         if (__builtin_strcmp(__s, &quot;C&quot;) != 0
<span class="lineNum">     799 </span>                :             &amp;&amp; __builtin_strcmp(__s, &quot;POSIX&quot;) != 0)
<span class="lineNum">     800 </span>                :           {
<span class="lineNum">     801 </span>                :             this-&gt;_S_destroy_c_locale(this-&gt;_M_c_locale_collate);
<span class="lineNum">     802 </span>                :             this-&gt;_S_create_c_locale(this-&gt;_M_c_locale_collate, __s);
<span class="lineNum">     803 </span>                :           }
<span class="lineNum">     804 </span>                :       }
<span class="lineNum">     805 </span>                : 
<span class="lineNum">     806 </span>                :     protected:
<span class="lineNum">     807 </span>                :       virtual
<span class="lineNum">     808 </span>                :       ~collate_byname() { }
<span class="lineNum">     809 </span>                :     };
<span class="lineNum">     810 </span>                : 
<span class="lineNum">     811 </span>                : _GLIBCXX_END_NAMESPACE
<span class="lineNum">     812 </span>                : 
<span class="lineNum">     813 </span>                : #ifndef _GLIBCXX_EXPORT_TEMPLATE
<span class="lineNum">     814 </span>                : # include &lt;bits/locale_classes.tcc&gt;
<span class="lineNum">     815 </span>                : #endif
<span class="lineNum">     816 </span>                : 
<span class="lineNum">     817 </span>                : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
